//
//  SDPrefixViewController.m
//  SDAlertView
//
//  Created by sander on 10/21/2017.
//  Copyright (c) 2017 sander. All rights reserved.
//

#import "SDPrefixViewController.h"
#import "SDAlertViewController.h"
@interface SDPrefixViewController ()
//@property (nonatomic, weak) UIButton * theShowB

@end

@implementation SDPrefixViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
    
    self.view.backgroundColor = [UIColor whiteColor];
	// Do any additional setup after loading the view, typically from a nib.
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


- (IBAction)on_touch_action:(id)sender
{
    [self show_alertView];
}
- (void)show_actionsheet
{
    SDAlertViewController * alert = [SDAlertViewController actionSheetWithTitle:@"咩有wifi网络"];
    alert.action_button_height = 100;
    NSAttributedString * sure_title = [[NSAttributedString alloc] initWithString:@"确定" attributes:@{NSFontAttributeName: [UIFont systemFontOfSize:17],NSForegroundColorAttributeName:[UIColor blackColor]}];
    NSAttributedString * cancel_title = [[NSAttributedString alloc] initWithString:@"取消" attributes:@{NSFontAttributeName: [UIFont systemFontOfSize:17],NSForegroundColorAttributeName:[UIColor blackColor]}];
    
    __weak typeof(self) weak_self = self;
    [alert addAlertButton:sure_title andActionSelected:YES alertAction:^(id target) {
        
        [weak_self push_viewController];
    }];
    
    [alert addAlertButton:cancel_title andActionSelected:false alertAction:^(id target) {
        
    }];
    
    [alert showAlert];
    
}
- (void)show_alertView
{
//    SDAlertViewController * alert = [SDAlertViewController alertTitle:@"通知" message:@"#######################是个sb"];
    
    UIView * view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, screen_width - 20, 200)];
    SDAlertViewController * alert = [SDAlertViewController alertTitle:@"通知" contentView:view];
    
    NSAttributedString * sure_title = [[NSAttributedString alloc] initWithString:@"确定" attributes:@{NSFontAttributeName: [UIFont systemFontOfSize:17],NSForegroundColorAttributeName:[UIColor whiteColor]}];
    NSAttributedString * cancel_title = [[NSAttributedString alloc] initWithString:@"取消" attributes:@{NSFontAttributeName: [UIFont systemFontOfSize:17],NSForegroundColorAttributeName:[UIColor blackColor]}];
    
    __weak typeof(self) weak_self = self;
    [alert addAlertButton:sure_title andActionSelected:YES alertAction:^(id target) {
        
        [weak_self push_viewController];
    }];
    
    [alert addAlertButton:cancel_title andActionSelected:false alertAction:^(id target) {
        
    }];
    
    [alert showAlert];
}

- (void)push_viewController
{
    SDPrefixViewController * viewController = [[SDPrefixViewController alloc] init];
    
    [self.navigationController pushViewController:viewController animated:YES];
}

@end
